
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 04/07/2012 23:08:39
-- Generated from EDMX file: F:\Dev\WorkWeb\ProjectTemplate\CodeBuilder\Entity.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [EntityDbContext];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[FK_Log_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_Log] DROP CONSTRAINT [FK_Log_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_User_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_User] DROP CONSTRAINT [FK_User_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_UserExtension_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_UserExtension] DROP CONSTRAINT [FK_UserExtension_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_EntityFunBase_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_EntityFunBase] DROP CONSTRAINT [FK_EntityFunBase_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticleInfo_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticleInfo] DROP CONSTRAINT [FK_ArticleInfo_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_LinkInfo_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_LinkInfo] DROP CONSTRAINT [FK_LinkInfo_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_LinkClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_LinkClass] DROP CONSTRAINT [FK_LinkClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicInfo_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicInfo] DROP CONSTRAINT [FK_PicInfo_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_Role_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_Role] DROP CONSTRAINT [FK_Role_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_UserRole_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_UserRole] DROP CONSTRAINT [FK_UserRole_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoComm_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoComm] DROP CONSTRAINT [FK_VideoComm_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoInfo_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoInfo] DROP CONSTRAINT [FK_VideoInfo_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticleClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticleClass] DROP CONSTRAINT [FK_ArticleClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticleComm_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticleComm] DROP CONSTRAINT [FK_ArticleComm_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicComm_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicComm] DROP CONSTRAINT [FK_PicComm_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoPic_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoPic] DROP CONSTRAINT [FK_VideoPic_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticlePic_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticlePic] DROP CONSTRAINT [FK_ArticlePic_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicClass] DROP CONSTRAINT [FK_PicClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoClass] DROP CONSTRAINT [FK_VideoClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicTag_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicTag] DROP CONSTRAINT [FK_PicTag_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicInfoClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicInfoClass] DROP CONSTRAINT [FK_PicInfoClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicThumb_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicThumb] DROP CONSTRAINT [FK_PicThumb_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_PicThumbClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_PicThumbClass] DROP CONSTRAINT [FK_PicThumbClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_LinkPic_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_LinkPic] DROP CONSTRAINT [FK_LinkPic_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoTag_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoTag] DROP CONSTRAINT [FK_VideoTag_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticleTag_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticleTag] DROP CONSTRAINT [FK_ArticleTag_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_ArticleInfoClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_ArticleInfoClass] DROP CONSTRAINT [FK_ArticleInfoClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_VideoInfoClass_inherits_EntityFunBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_VideoInfoClass] DROP CONSTRAINT [FK_VideoInfoClass_inherits_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[FK_MvcController_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_MvcController] DROP CONSTRAINT [FK_MvcController_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_MvcAction_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_MvcAction] DROP CONSTRAINT [FK_MvcAction_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_MvcControllerClass_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_MvcControllerClass] DROP CONSTRAINT [FK_MvcControllerClass_inherits_EntityBase];
GO
IF OBJECT_ID(N'[dbo].[FK_MvcRolePermission_inherits_EntityBase]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[EntityBase_MvcRolePermission] DROP CONSTRAINT [FK_MvcRolePermission_inherits_EntityBase];
GO

-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[EntityBase]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_Log]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_Log];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_User]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_User];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_UserExtension]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_UserExtension];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_EntityFunBase]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_EntityFunBase];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticleInfo]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticleInfo];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_LinkInfo]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_LinkInfo];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_LinkClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_LinkClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicInfo]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicInfo];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_Role]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_Role];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_UserRole]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_UserRole];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoComm]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoComm];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoInfo]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoInfo];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticleClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticleClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticleComm]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticleComm];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicComm]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicComm];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoPic]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoPic];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticlePic]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticlePic];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicTag]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicTag];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicInfoClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicInfoClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicThumb]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicThumb];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_PicThumbClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_PicThumbClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_LinkPic]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_LinkPic];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoTag]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoTag];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticleTag]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticleTag];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_ArticleInfoClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_ArticleInfoClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_VideoInfoClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_VideoInfoClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_MvcController]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_MvcController];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_MvcAction]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_MvcAction];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_MvcControllerClass]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_MvcControllerClass];
GO
IF OBJECT_ID(N'[dbo].[EntityBase_MvcRolePermission]', 'U') IS NOT NULL
    DROP TABLE [dbo].[EntityBase_MvcRolePermission];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'EntityBase'
CREATE TABLE [dbo].[EntityBase] (
    [Id] int IDENTITY(1,1) NOT NULL,
    [AddTime] datetime  NOT NULL,
    [IpAddress] nvarchar(100)  NOT NULL,
    [State] bit  NOT NULL,
    [SortNum] int  NOT NULL
);
GO

-- Creating table 'EntityBase_Log'
CREATE TABLE [dbo].[EntityBase_Log] (
    [TypeId] int  NULL,
    [UserId] int  NULL,
    [PageUrl] nvarchar(2000)  NULL,
    [ReferrerUrl] nvarchar(2000)  NULL,
    [FullMessage] nvarchar(4000)  NULL,
    [ShortMessage] nvarchar(4000)  NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_User'
CREATE TABLE [dbo].[EntityBase_User] (
    [UserName] nvarchar(200)  NULL,
    [Pwd] nvarchar(200)  NULL,
    [TrueName] varchar(200)  NULL,
    [Sex] bit  NOT NULL,
    [Phone] varchar(100)  NULL,
    [UserType] int  NULL,
    [Guid] varchar(100)  NULL,
    [DepartmentID] int  NULL,
    [Email] varchar(100)  NULL,
    [IsActivity] bit  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_UserExtension'
CREATE TABLE [dbo].[EntityBase_UserExtension] (
    [UserId] int  NOT NULL,
    [SinaWeiboId] varchar(100)  NULL,
    [SinaWeiboScreenName] varchar(200)  NULL,
    [QQWeiboId] varchar(100)  NULL,
    [QQWeiboScreenName] varchar(200)  NULL,
    [QQNum] nvarchar(100)  NOT NULL,
    [UserName] nvarchar(500)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_EntityFunBase'
CREATE TABLE [dbo].[EntityBase_EntityFunBase] (
    [UserId] int  NOT NULL,
    [UserName] nvarchar(200)  NOT NULL,
    [IsAud] bit  NOT NULL,
    [IsDelete] bit  NOT NULL,
    [IsVouch] bit  NOT NULL,
    [IsTop] bit  NOT NULL,
    [AudTime] datetime  NULL,
    [DeleteTime] datetime  NULL,
    [VouchTime] datetime  NULL,
    [TopTime] datetime  NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticleInfo'
CREATE TABLE [dbo].[EntityBase_ArticleInfo] (
    [Title] varchar(500)  NOT NULL,
    [SubTitle] varchar(500)  NULL,
    [Content] nvarchar(max)  NOT NULL,
    [ViewCount] int  NOT NULL,
    [Source] nvarchar(500)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_LinkInfo'
CREATE TABLE [dbo].[EntityBase_LinkInfo] (
    [ClassId] int  NOT NULL,
    [Title] varchar(500)  NOT NULL,
    [Uri] varchar(1000)  NOT NULL,
    [Remark] varchar(1000)  NOT NULL,
    [ViewCount] int  NOT NULL,
    [IsPicLink] bit  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_LinkClass'
CREATE TABLE [dbo].[EntityBase_LinkClass] (
    [Name] varchar(200)  NULL,
    [ParentId] int  NOT NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicInfo'
CREATE TABLE [dbo].[EntityBase_PicInfo] (
    [Name] varchar(500)  NULL,
    [Remark] varchar(1000)  NULL,
    [ViewCount] int  NOT NULL,
    [PicPath] varchar(1000)  NULL,
    [Source] varchar(500)  NULL,
    [Width] int  NOT NULL,
    [Height] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_Role'
CREATE TABLE [dbo].[EntityBase_Role] (
    [Name] varchar(500)  NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_UserRole'
CREATE TABLE [dbo].[EntityBase_UserRole] (
    [UserId] int  NOT NULL,
    [RoleId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoComm'
CREATE TABLE [dbo].[EntityBase_VideoComm] (
    [VideoId] int  NOT NULL,
    [Content] nvarchar(max)  NOT NULL,
    [Fen] int  NOT NULL,
    [ParentId] int  NOT NULL,
    [ClientType] nvarchar(200)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoInfo'
CREATE TABLE [dbo].[EntityBase_VideoInfo] (
    [Name] varchar(500)  NULL,
    [Remark] varchar(1000)  NULL,
    [ViewCount] int  NOT NULL,
    [Path] varchar(200)  NULL,
    [Source] varchar(500)  NULL,
    [Score] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticleClass'
CREATE TABLE [dbo].[EntityBase_ArticleClass] (
    [Name] varchar(200)  NULL,
    [ParentId] int  NOT NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticleComm'
CREATE TABLE [dbo].[EntityBase_ArticleComm] (
    [ArticleId] int  NOT NULL,
    [Content] nvarchar(max)  NOT NULL,
    [Fen] int  NOT NULL,
    [ParentId] int  NOT NULL,
    [ClientType] nvarchar(200)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicComm'
CREATE TABLE [dbo].[EntityBase_PicComm] (
    [PicId] int  NOT NULL,
    [Content] nvarchar(max)  NOT NULL,
    [Fen] int  NOT NULL,
    [ParentId] nvarchar(max)  NOT NULL,
    [ClientType] nvarchar(200)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoPic'
CREATE TABLE [dbo].[EntityBase_VideoPic] (
    [VideoId] int  NOT NULL,
    [PicId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticlePic'
CREATE TABLE [dbo].[EntityBase_ArticlePic] (
    [ArticleId] int  NOT NULL,
    [PicId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicClass'
CREATE TABLE [dbo].[EntityBase_PicClass] (
    [Name] varchar(200)  NULL,
    [ParentId] int  NOT NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoClass'
CREATE TABLE [dbo].[EntityBase_VideoClass] (
    [Name] varchar(100)  NULL,
    [ParentId] int  NOT NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicTag'
CREATE TABLE [dbo].[EntityBase_PicTag] (
    [Name] nvarchar(500)  NOT NULL,
    [PicId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicInfoClass'
CREATE TABLE [dbo].[EntityBase_PicInfoClass] (
    [Name] nvarchar(500)  NOT NULL,
    [PicId] int  NOT NULL,
    [ClassId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicThumb'
CREATE TABLE [dbo].[EntityBase_PicThumb] (
    [Name] varchar(500)  NULL,
    [Remark] varchar(1000)  NULL,
    [ViewCount] int  NOT NULL,
    [PicPath] varchar(1000)  NULL,
    [PicId] int  NOT NULL,
    [ThumbClassId] int  NOT NULL,
    [Width] int  NOT NULL,
    [Height] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_PicThumbClass'
CREATE TABLE [dbo].[EntityBase_PicThumbClass] (
    [Name] varchar(200)  NULL,
    [ParentId] int  NOT NULL,
    [Remark] nvarchar(1000)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_LinkPic'
CREATE TABLE [dbo].[EntityBase_LinkPic] (
    [LinkId] int  NOT NULL,
    [PicId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoTag'
CREATE TABLE [dbo].[EntityBase_VideoTag] (
    [Name] nvarchar(500)  NOT NULL,
    [VideoId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticleTag'
CREATE TABLE [dbo].[EntityBase_ArticleTag] (
    [Name] nvarchar(500)  NOT NULL,
    [ArticleId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_ArticleInfoClass'
CREATE TABLE [dbo].[EntityBase_ArticleInfoClass] (
    [ArticleId] int  NOT NULL,
    [ClassId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_VideoInfoClass'
CREATE TABLE [dbo].[EntityBase_VideoInfoClass] (
    [VideoId] int  NOT NULL,
    [ClassId] int  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_MvcController'
CREATE TABLE [dbo].[EntityBase_MvcController] (
    [ClassId] int  NOT NULL,
    [AssemblyFullName] nvarchar(max)  NOT NULL,
    [Name] nvarchar(max)  NOT NULL,
    [Remark] nvarchar(max)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_MvcAction'
CREATE TABLE [dbo].[EntityBase_MvcAction] (
    [ControllerId] int  NOT NULL,
    [Name] nvarchar(200)  NOT NULL,
    [Remark] nvarchar(max)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_MvcControllerClass'
CREATE TABLE [dbo].[EntityBase_MvcControllerClass] (
    [Name] nvarchar(max)  NOT NULL,
    [Remark] nvarchar(max)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- Creating table 'EntityBase_MvcRolePermission'
CREATE TABLE [dbo].[EntityBase_MvcRolePermission] (
    [ActionId] int  NOT NULL,
    [RoleId] int  NOT NULL,
    [Name] nvarchar(max)  NOT NULL,
    [Remark] nvarchar(max)  NOT NULL,
    [Id] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [Id] in table 'EntityBase'
ALTER TABLE [dbo].[EntityBase]
ADD CONSTRAINT [PK_EntityBase]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_Log'
ALTER TABLE [dbo].[EntityBase_Log]
ADD CONSTRAINT [PK_EntityBase_Log]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_User'
ALTER TABLE [dbo].[EntityBase_User]
ADD CONSTRAINT [PK_EntityBase_User]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_UserExtension'
ALTER TABLE [dbo].[EntityBase_UserExtension]
ADD CONSTRAINT [PK_EntityBase_UserExtension]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_EntityFunBase'
ALTER TABLE [dbo].[EntityBase_EntityFunBase]
ADD CONSTRAINT [PK_EntityBase_EntityFunBase]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticleInfo'
ALTER TABLE [dbo].[EntityBase_ArticleInfo]
ADD CONSTRAINT [PK_EntityBase_ArticleInfo]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_LinkInfo'
ALTER TABLE [dbo].[EntityBase_LinkInfo]
ADD CONSTRAINT [PK_EntityBase_LinkInfo]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_LinkClass'
ALTER TABLE [dbo].[EntityBase_LinkClass]
ADD CONSTRAINT [PK_EntityBase_LinkClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicInfo'
ALTER TABLE [dbo].[EntityBase_PicInfo]
ADD CONSTRAINT [PK_EntityBase_PicInfo]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_Role'
ALTER TABLE [dbo].[EntityBase_Role]
ADD CONSTRAINT [PK_EntityBase_Role]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_UserRole'
ALTER TABLE [dbo].[EntityBase_UserRole]
ADD CONSTRAINT [PK_EntityBase_UserRole]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoComm'
ALTER TABLE [dbo].[EntityBase_VideoComm]
ADD CONSTRAINT [PK_EntityBase_VideoComm]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoInfo'
ALTER TABLE [dbo].[EntityBase_VideoInfo]
ADD CONSTRAINT [PK_EntityBase_VideoInfo]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticleClass'
ALTER TABLE [dbo].[EntityBase_ArticleClass]
ADD CONSTRAINT [PK_EntityBase_ArticleClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticleComm'
ALTER TABLE [dbo].[EntityBase_ArticleComm]
ADD CONSTRAINT [PK_EntityBase_ArticleComm]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicComm'
ALTER TABLE [dbo].[EntityBase_PicComm]
ADD CONSTRAINT [PK_EntityBase_PicComm]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoPic'
ALTER TABLE [dbo].[EntityBase_VideoPic]
ADD CONSTRAINT [PK_EntityBase_VideoPic]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticlePic'
ALTER TABLE [dbo].[EntityBase_ArticlePic]
ADD CONSTRAINT [PK_EntityBase_ArticlePic]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicClass'
ALTER TABLE [dbo].[EntityBase_PicClass]
ADD CONSTRAINT [PK_EntityBase_PicClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoClass'
ALTER TABLE [dbo].[EntityBase_VideoClass]
ADD CONSTRAINT [PK_EntityBase_VideoClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicTag'
ALTER TABLE [dbo].[EntityBase_PicTag]
ADD CONSTRAINT [PK_EntityBase_PicTag]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicInfoClass'
ALTER TABLE [dbo].[EntityBase_PicInfoClass]
ADD CONSTRAINT [PK_EntityBase_PicInfoClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicThumb'
ALTER TABLE [dbo].[EntityBase_PicThumb]
ADD CONSTRAINT [PK_EntityBase_PicThumb]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_PicThumbClass'
ALTER TABLE [dbo].[EntityBase_PicThumbClass]
ADD CONSTRAINT [PK_EntityBase_PicThumbClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_LinkPic'
ALTER TABLE [dbo].[EntityBase_LinkPic]
ADD CONSTRAINT [PK_EntityBase_LinkPic]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoTag'
ALTER TABLE [dbo].[EntityBase_VideoTag]
ADD CONSTRAINT [PK_EntityBase_VideoTag]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticleTag'
ALTER TABLE [dbo].[EntityBase_ArticleTag]
ADD CONSTRAINT [PK_EntityBase_ArticleTag]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_ArticleInfoClass'
ALTER TABLE [dbo].[EntityBase_ArticleInfoClass]
ADD CONSTRAINT [PK_EntityBase_ArticleInfoClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_VideoInfoClass'
ALTER TABLE [dbo].[EntityBase_VideoInfoClass]
ADD CONSTRAINT [PK_EntityBase_VideoInfoClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_MvcController'
ALTER TABLE [dbo].[EntityBase_MvcController]
ADD CONSTRAINT [PK_EntityBase_MvcController]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_MvcAction'
ALTER TABLE [dbo].[EntityBase_MvcAction]
ADD CONSTRAINT [PK_EntityBase_MvcAction]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_MvcControllerClass'
ALTER TABLE [dbo].[EntityBase_MvcControllerClass]
ADD CONSTRAINT [PK_EntityBase_MvcControllerClass]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- Creating primary key on [Id] in table 'EntityBase_MvcRolePermission'
ALTER TABLE [dbo].[EntityBase_MvcRolePermission]
ADD CONSTRAINT [PK_EntityBase_MvcRolePermission]
    PRIMARY KEY CLUSTERED ([Id] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- Creating foreign key on [Id] in table 'EntityBase_Log'
ALTER TABLE [dbo].[EntityBase_Log]
ADD CONSTRAINT [FK_Log_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_User'
ALTER TABLE [dbo].[EntityBase_User]
ADD CONSTRAINT [FK_User_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_UserExtension'
ALTER TABLE [dbo].[EntityBase_UserExtension]
ADD CONSTRAINT [FK_UserExtension_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_EntityFunBase'
ALTER TABLE [dbo].[EntityBase_EntityFunBase]
ADD CONSTRAINT [FK_EntityFunBase_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticleInfo'
ALTER TABLE [dbo].[EntityBase_ArticleInfo]
ADD CONSTRAINT [FK_ArticleInfo_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_LinkInfo'
ALTER TABLE [dbo].[EntityBase_LinkInfo]
ADD CONSTRAINT [FK_LinkInfo_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_LinkClass'
ALTER TABLE [dbo].[EntityBase_LinkClass]
ADD CONSTRAINT [FK_LinkClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicInfo'
ALTER TABLE [dbo].[EntityBase_PicInfo]
ADD CONSTRAINT [FK_PicInfo_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_Role'
ALTER TABLE [dbo].[EntityBase_Role]
ADD CONSTRAINT [FK_Role_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_UserRole'
ALTER TABLE [dbo].[EntityBase_UserRole]
ADD CONSTRAINT [FK_UserRole_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoComm'
ALTER TABLE [dbo].[EntityBase_VideoComm]
ADD CONSTRAINT [FK_VideoComm_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoInfo'
ALTER TABLE [dbo].[EntityBase_VideoInfo]
ADD CONSTRAINT [FK_VideoInfo_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticleClass'
ALTER TABLE [dbo].[EntityBase_ArticleClass]
ADD CONSTRAINT [FK_ArticleClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticleComm'
ALTER TABLE [dbo].[EntityBase_ArticleComm]
ADD CONSTRAINT [FK_ArticleComm_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicComm'
ALTER TABLE [dbo].[EntityBase_PicComm]
ADD CONSTRAINT [FK_PicComm_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoPic'
ALTER TABLE [dbo].[EntityBase_VideoPic]
ADD CONSTRAINT [FK_VideoPic_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticlePic'
ALTER TABLE [dbo].[EntityBase_ArticlePic]
ADD CONSTRAINT [FK_ArticlePic_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicClass'
ALTER TABLE [dbo].[EntityBase_PicClass]
ADD CONSTRAINT [FK_PicClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoClass'
ALTER TABLE [dbo].[EntityBase_VideoClass]
ADD CONSTRAINT [FK_VideoClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicTag'
ALTER TABLE [dbo].[EntityBase_PicTag]
ADD CONSTRAINT [FK_PicTag_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicInfoClass'
ALTER TABLE [dbo].[EntityBase_PicInfoClass]
ADD CONSTRAINT [FK_PicInfoClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicThumb'
ALTER TABLE [dbo].[EntityBase_PicThumb]
ADD CONSTRAINT [FK_PicThumb_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_PicThumbClass'
ALTER TABLE [dbo].[EntityBase_PicThumbClass]
ADD CONSTRAINT [FK_PicThumbClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_LinkPic'
ALTER TABLE [dbo].[EntityBase_LinkPic]
ADD CONSTRAINT [FK_LinkPic_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoTag'
ALTER TABLE [dbo].[EntityBase_VideoTag]
ADD CONSTRAINT [FK_VideoTag_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticleTag'
ALTER TABLE [dbo].[EntityBase_ArticleTag]
ADD CONSTRAINT [FK_ArticleTag_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_ArticleInfoClass'
ALTER TABLE [dbo].[EntityBase_ArticleInfoClass]
ADD CONSTRAINT [FK_ArticleInfoClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_VideoInfoClass'
ALTER TABLE [dbo].[EntityBase_VideoInfoClass]
ADD CONSTRAINT [FK_VideoInfoClass_inherits_EntityFunBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase_EntityFunBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_MvcController'
ALTER TABLE [dbo].[EntityBase_MvcController]
ADD CONSTRAINT [FK_MvcController_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_MvcAction'
ALTER TABLE [dbo].[EntityBase_MvcAction]
ADD CONSTRAINT [FK_MvcAction_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_MvcControllerClass'
ALTER TABLE [dbo].[EntityBase_MvcControllerClass]
ADD CONSTRAINT [FK_MvcControllerClass_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Id] in table 'EntityBase_MvcRolePermission'
ALTER TABLE [dbo].[EntityBase_MvcRolePermission]
ADD CONSTRAINT [FK_MvcRolePermission_inherits_EntityBase]
    FOREIGN KEY ([Id])
    REFERENCES [dbo].[EntityBase]
        ([Id])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------